package 链表;

public class ListNode {
	int val;
	ListNode next;
	ListNode(int x) { 
        val = x; 
        next = null;
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
		ListNode tmp = this;
        while (tmp !=  null) {
            sb.append(tmp.val);
            sb.append('_');
            tmp = tmp.next;
        } 
        sb.append("null");        
        return sb.toString();
    }
}